import { createRouter, createWebHistory } from "vue-router";

const routes = [
	{
		path:"/",
		redirect:"/home"
	},
    //任務大廳
    {
        path:"/",
        name:"layout",
        component: () => import("../views/layout.vue"),
        children:[
			{
				path: "/home",
				name: "home",
				component:() => import("../views/home/index.vue"),
			},
			//系统管理
            {
                path: "/admin",
                name: "admin",
                component:() => import("../views/system/admin.vue"),
            },{
                path: "/role",
                name: "role",
                component:() => import("../views/system/role.vue"),
            },{
                path: "/roleOption",
                name: "roleOption",
                component:() => import("../views/system/roleOption.vue"),
            },{
                path: "/menu",
                name: "menu",
                component:() => import("../views/system/menu.vue"),
            },
			//在线工具
			{
                path: "/onlineToolType",
                name: "onlineToolType",
                component:() => import("../views/onlineTool/onlineToolType.vue"),
            },
			{
                path: "/onlineToolList",
                name: "onlineToolList",
                component:() => import("../views/onlineTool/onlineToolList.vue"),
            },
			{
                path: "/onlineToolAdd",
                name: "onlineToolAdd",
                component:() => import("../views/onlineTool/onlineToolAdd.vue"),
            },
            //工具列表
			{
                path: "/toolType",
                name: "toolType",
                component:() => import("../views/tool/toolType.vue"),
            },
			{
                path: "/toolList",
                name: "toolList",
                component:() => import("../views/tool/toolList.vue"),
            },
			{
                path: "/toolAdd",
                name: "toolAdd",
                component:() => import("../views/tool/toolAdd.vue"),
            },
			//网站信息
			{
                path: "/navbar",
                name: "navbar",
                component:() => import("../views/platform/navbar.vue"),
            },
			{
                path: "/info",
                name: "info",
                component:() => import("../views/platform/info.vue"),
            },
			//资源分类
			{
                path: "/resourceLinkType",
                name: "resourceLinkType",
                component:() => import("../views/resourceLink/resourceLinkType.vue"),
            },
			{
                path: "/resourceLinkList",
                name: "resourceLinkList",
                component:() => import("../views/resourceLink/resourceLinkList.vue"),
            },
			{
                path: "/resourceLinkAdd",
                name: "resourceLinkAdd",
                component:() => import("../views/resourceLink/resourceLinkAdd.vue"),
            },
			//密码查询
			{
                path: "/devicePasswordList",
                name: "devicePasswordList",
                component:() => import("../views/devicePassword/devicePasswordList.vue"),
            },
			{
                path: "/devicePasswordAdd",
                name: "devicePasswordAdd",
                component:() => import("../views/devicePassword/devicePasswordAdd.vue"),
            },
			//文章管理
			{
                path: "/articleType",
                name: "articleType",
                component:() => import("../views/article/articleType.vue"),
            },
			{
                path: "/bugArticle",
                name: "bugArticle",
                component:() => import("../views/article/bugArticle/index.vue"),
            },
			{
                path: "/bugAdd",
                name: "bugAdd",
                component:() => import("../views/article/bugArticle/add.vue"),
            },
            {
                path: "/technicalArticle",
                name: "technicalArticle",
                component:() => import("../views/article/technicalArticle/index.vue"),
            },
			{
                path: "/technicalArticleAdd",
                name: "technicalArticleAdd",
                component:() => import("../views/article/technicalArticle/add.vue"),
            },
			// 用户管理
			{
                path: "/user",
                name: "user",
                component:() => import("../views/user/userList.vue"),
            },
            // 审核
			{
                path: "/commentAudit",
                name: "commentAudit",
                component:() => import("../views/audit/commentAudit.vue"),
            },
			{
                path: "/articleAudit",
                name: "articleAudit",
                component:() => import("../views/audit/articleAudit.vue"),
            },
			{
                path: "/articleDetail",
                name: "articleDetail",
                component:() => import("../views/audit/articleDetail.vue"),
            },
			{
                path: "/clientMgmt",
                name: "clientMgmt",
                component:() => import("../views/system/clientMgmt.vue"),
            },
			{
                path: "/homeConfig",
                name: "homeConfig",
                component:() => import("../views/platform/homeConfig.vue"),
            },
			{
				path:"*",
				redirect:"/home"
			}
        ]
    },
    {
        path: "/login",
        name: "login",
        component: () => import("../views/login.vue"),
    },
    {
        path: "/forgetPwd",
        name: "forgetPwd",
        component: () => import("../views/forgetPwd.vue"),
    },
];

const router = createRouter({
    history: createWebHistory(process.env.VUE_APP_BASEPATH),
    routes,
    scrollBehavior() {
        return { x: 0, y: 0 };
    },
});
export default router;
